package com.fgchen.biz;

import com.fgchen.domain.study02.Animal;
import com.fgchen.mapper.study02.AnimalMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.Collection;

/**
 * Created by Administrator on 2018-04-08.
 */
@Service
public class AnimalBiz {

    @Autowired
    private AnimalMapper animalMapper;

    public Collection<Animal> findAll() {
        return this.animalMapper.findAll();
    }

    public Animal get(Long id) {
        return this.animalMapper.get(id);
    }

    @Transactional
    public int insert(String name, Integer age) {
        return this.animalMapper.insert(name, age);
    }

}
